  {% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set panel = 'dashboard' %}
{% set script_controller = 'default/index' %}
{% block content %}

<div class="page-header">
  <h1>管理中心  </h1>
</div>

{% if is_granted('ROLE_ADMIN') %}
  
  <div class="row">
    <div class="col-md-12">
      <div id="app-upgrade-alert" class="alert alert-info alert-dismissable hide" data-url="{{path('admin_app_upgrades_count') }}" data-upgrade-url="{{ path('admin_app_upgrades') }}">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
      </div>
    </div>

  <div class="col-md-12">
        {{ render(controller('TopxiaAdminBundle:Default:getCloudNotices')) }}
    </div>


 <div class="col-md-6">
  <div class="panel panel-default">
  
    <div class="panel-heading clearfix">
     <span class="pull-right" style="display:block">
         <span id="onlineNum" data-url="{{path('admin_online_count')}}">正在载入在线人数...</span>（<span id="loginNum" data-url="{{path('admin_login_count')}}">正在载入登录人数...</span>）
     </span>
     <h3 class="panel-title pull-left" id="operation-analysis-title" data-url="{{path('admin_operation_analysis')}}"> 数据统计

     </h3>
    </div>
    <div id="operation-analysis-table" >
      <div class="empty">正在载入数据，请稍等。</div>
    </div>
  </div>
</div>
{#     <div class="col-md-6">
       <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title" id="open-message-title" data-url="{{path('admin_official_messages')}}">EduSoho官方消息</h3>
        </div>
        <div id="edusoho-open-message" >
          <div class="empty">正在载入数据，请稍等。</div>
        </div>
      </div>
    </div> #}
    <div class="col-md-6">
       <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title" id="system-status-title" data-url="{{path('admin_system_status')}}">系统状态</h3>
        </div>
        <div id="system-status" >
          <div class="empty">正在载入数据，请稍等。</div>
        </div>
      </div>
    </div>
    <div id="popular-courses-panel" class="col-md-6">
       <div class="panel panel-default">
        <div class="panel-heading">
          <select id="popular-courses-type" class="pull-right" data-url="{{path('admin_popular_courses')}}">
              {{ select_options(dict('dateType'), app.request.query.get('dateType')) }}
          </select>
          <h3 class="panel-title">受欢迎课程</h3>
        </div>
        <div id="popular-courses-table">
        	<div class="empty">正在载入数据，请稍等。</div>
        </div>
      </div>
    </div>
  </div>

  <div class="row">
    {{ render(controller('TopxiaAdminBundle:Default:unsolvedQuestionsBlock')) }}
  </div>

  <div class="row">
    {{ render(controller('TopxiaAdminBundle:Default:latestPaidOrdersBlock')) }}
  </div>

{% else %}
  <div class="row">
    <div class="col-md-12">
      <h4>欢迎来到{{ setting('site.name') }}管理后台</h4>
    </div>
  </div>
{% endif %}

{% endblock %}